// 模拟从服务器获取路由表信息，实现动态路由
const routes = [
    {
        path: "",
        redirect: "/home/controlpanel",
    },
    {
        path: "controlpanel",
        name: "controlpanel",
        meta: {
            title: "控制面板",
            role: "PMC001",
            icon: "el-icon-menu",
            submenu: false,
        },
        component: () =>
            import(/* webpackChunkName: "other" */ "@/views/ControlPanel.vue"),
    },
    {
        path: "classification",
        name: "classification",
        meta: {
            title: "分类管理",
            role: "PMF200",
            icon: "el-icon-tickets",
            submenu: false,
        },
        component: () =>
            import(/* webpackChunkName: "other" */ "@/views/ClassiFication.vue"),
    },
    {
        path: "goodsmanager",
        name: "goodsmanager",
        meta: {
            title: "商品管理",
            role: "PMG300",
            icon: "el-icon-shopping-cart-full",
            submenu: false,
        },
        component: () =>
            import(/* webpackChunkName: "other" */ "@/views/GoodsManager.vue"),
    },
    {
        path: "membermanager",
        name: "membermanager",
        meta: {
            title: "会员管理",
            role: "PMM400",
            icon: "el-icon-user",
            submenu: false,
        },
        component: () =>
            import(/* webpackChunkName: "other" */ "@/views/MemberManager.vue"),
    },
    {
        path: "ordermanager",
        name: "ordermanager",
        meta: {
            title: "订单管理",
            role: "PMR500",
            icon: "el-icon-s-order",
            submenu: false,
        },
        component: () =>
            import(/* webpackChunkName: "other" */ "@/views/OrderManager.vue"),
    },
    {
        path: "bannersetting",
        name: "bannersetting",
        meta: {
            title: "轮播图设置",
            role: "PMH100",
            icon: "el-icon-picture-outline",
            submenu: true,
        },
        component: () =>
            import(/* webpackChunkName: "home" */ "@/views/Home/BannerSetting.vue"),
    },
    {
        path: "goodssetting",
        name: "goodssetting",
        meta: {
            title: "热销商品设置",
            role: "PMH100",
            icon: "el-icon-wallet",
            submenu: true,
        },
        component: () =>
            import(/* webpackChunkName: "home" */ "@/views/Home/GoodsSetting.vue"),
    },
    {
        path: "productsetting",
        name: "productsetting",
        meta: {
            title: "新品上线设置",
            role: "PMH100",
            icon: "el-icon-position",
            submenu: true,
        },
        component: () =>
            import(/* webpackChunkName: "home" */ "@/views/Home/ProductSetting.vue"),
    },
    {
        path: "recommendsetting",
        name: "recommendsetting",
        meta: {
            title: "为你推荐设置",
            role: "PMH100",
            icon: "el-icon-thumb",
            submenu: true,
        },
        component: () =>
            import(
          /* webpackChunkName: "home" */ "@/views/Home/RecommendSetting.vue"
            ),
    }
];
const queryRoutes = () => {
    return new Promise((resolve) => {
        setTimeout(() => {
            resolve(routes);
        }, 500);
    });
};
export default queryRoutes;